<template>
    <el-dialog :close-on-click-modal="false"  ref="dialogform" title="查看物料详情" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
        <el-table :data="tableData" style="width: 100%" border>
            <el-table-column type="index" width="50" label="序号">
            </el-table-column>
            <el-table-column prop="materialName" label="物料名称">
            </el-table-column>
            <el-table-column prop="num" label="物料数量" width="150">
            </el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
            <el-button @click="cancel">取 消</el-button>
        </span>
    </el-dialog>
</template>
<script>
export default {
    components: {},
    props: {
        addEditFlag: {
            type: String,
            default: () => {
                return 'add'
            }
        },
        tableData: {
            type: Array,
            default: () => {
                return []
            }
        },
        dialogVisible: {
            type: Boolean,
            default: () => {
                return false
            }
        }
    },
    data() {
        return {}
    },
    
    watch: {},
    
    mounted() {
        console.log(this.tableData)
    },
    methods: {
        //取消关闭
        cancel() {
            this.$emit("closeDialog")
        },
        handleClose(done) {
            this.$confirm('确认关闭？')
                .then(_ => { this.cancel () })
                .catch(_ => { });
        }
    }
};
</script>
<style lang="scss" scoped></style>
  